package com.basics.loan.web.boss.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.basics.loan.web.boss.bean.domain.RoleResource;

/**
 * 角色资源关联DAO
 *
 * @author yangxiaobing
 * @date 2017 7/24
 */
@Mapper
public interface RoleResourceMapper {
	int deleteByPrimaryKey(Integer roleResId);

	int insert(RoleResource record);

	int insertSelective(RoleResource record);

	RoleResource selectByPrimaryKey(Integer roleResId);

	int updateByPrimaryKeySelective(RoleResource record);

	int updateByPrimaryKey(RoleResource record);

	/**
	 * 根据roleId查询角色资源信息
	 * 
	 * @param roleId
	 *            角色Id
	 * @return
	 */
	List<RoleResource> selectRoleResourceByRoleId(@Param("roleId") Integer roleId);

	/**
	 * 根据roleId和resourceId查询角色资源信息
	 * 
	 * @param roleId
	 *            角色Id
	 * @param resourceId
	 *            资源Id
	 * @return
	 */
	RoleResource selectRoleResourceByRoleIdAndResId(@Param("roleId") Integer roleId,
			@Param("resourceId") Integer resourceId);

	/**
	 * 根据角色Id删除角色资源信息
	 * 
	 * @param roleId
	 *            角色Id
	 */
	void deleteRoleResourceByRoleId(@Param("roleId") Integer roleId);

}